#include "Rectangle.h"


void drawRect(int x, int y, int width, int height)
{
	drawRect(x,y,width,height,0);
}
void drawRect(int x, int y, int width, int height, float rotation)
{
	glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
	glEnable(GL_BLEND);

    glPushMatrix();
        glTranslated(x,y,0);
        glRotatef(rotation+180,0,0,1);
	
        glScaled(width,height, 0);
        glBegin(GL_QUADS);
			glTexCoord2f(0.0f,0.0f); glVertex3f(.5f,-.5f,0.0f);
			glTexCoord2f(0.0f,1.0f); glVertex3f(.5f,.5f,0.0f);
			glTexCoord2f(1.0f,1.0f); glVertex3f(-.5f,.5f,0.0f);
			glTexCoord2f(1.0f,0.0f); glVertex3f(-.5f,-.5f,0.0f);
        glEnd();
	glPopMatrix();

	glDisable(GL_BLEND);
}